package j04zuoye.com.hualan.raise;

public class RaiseTest {
    public static void main(String[] args) {
        Person daiyu = new Person();
        daiyu.raise(new Cat("加菲猫",2));
        daiyu.raise(new Snake("五步蛇",1));
//        daiyu.raise(new Animal("") {
//            @Override
//            public void eat() {
//
//            }
//        });

        daiyu.raise2(new Snake("眼镜蛇",3));

        daiyu.raise(new Animal("蝾螈",2) {
            @Override
            public void eat() {
                System.out.println(name+"吃虫子");
            }
        });
        daiyu.raise2(new IPet() {
            @Override
            public void eat() {
                System.out.println("宠物吃东西");
            }
        });

        daiyu.raise2(()->System.out.println("lambda吃食物"));


    }
}
